from Analytical_Functions_Report import *
main_df = pd.read_csv('data_final/main_table.csv', index_col=0)
ignore_list = ['rsp_id','country','start','end','organizacion','survey_pid','departamento','municipio','neighborhood',
'tipo_familia_other','why_int_not_ext','mig_motivo_stay_other','covid_impact','comentarios_finales','saving_months']
for attribute in main_df.columns:
if not attribute.startswith('_') and not ('/' in attribute) and not ('note' in attribute)and not ('other' in attribute) and not ('exp' in attribute) and not (attribute in ignore_list):
plot_data(main_df, attribute, split_country = True)
1.7 Area:
2.1 What is the sex of the person surveyed?
2.2 What is the age of the person surveyed?
2.3 What is the type of family that best defines your home today?
2.4 Including you, how many people have been in your household in the last 5 years?
2.22 Is there anyone in your household who needs help due to long-term difficulties with any of the following: (multiple choice, total response:[1730, 1565, 1703])
3.1 Ideally, if you had the opportunity, would you like to move permanently or for a long period to another country?
3.2 What are the main reasons why you would like to move to another country? (multiple choice, total response:[505, 757, 891])
3.3 Are you planning to move to another country in the next 12 months?
3.4 What are the main reasons why you have not planned to move to another country in the next 12 months? (multiple choice, total response:[412, 598, 802])
3.5 Have you made any preparation to move to another country?
3.5.1 What preparation have you made to move to another country? (multiple choice, total response:[42, 76, 42])
3.6 Ideally, if you had the opportunity, would you like to move to another part of the country?
3.7 What are the main reasons why you would like to move to another part of the country? (multiple choice, total response:[243, 433, 507])
3.8 Are you planning to move to another part of the country in the next 12 months?
3.9 What are the main reasons why you have not planned to move to another part of the country in the next 12 months? (multiple choice, total response:[176, 357, 471])
3.10 Have you made any preparations to move to another part of the country?
3.10.1 What preparation have you made to move to another part of the country? (multiple choice, total response:[28, 29, 9])
3.12 What are the main reasons why you would like to continue living in this country and in your current place of residence? (multiple choice, total response:[1126, 709, 651])
3.13 How many people in the household or who have been part of the household have migrated or tried to migrate abroad in the last 5 years?
3.27 In general, do you consider that migration abroad brings more good or bad consequences to families?
3.28 What do you consider to be the three main good consequences of migration abroad for families? (multiple choice, total response:[961, 1099, 1269])
3.29 What do you consider to be the three main bad consequences of migration abroad for families? (multiple choice, total response:[943, 950, 1150])
3.30 In the last 12 months, has your household received financial aid from abroad?
3.31 How is the person who sends the financial aid with the greatest impact related to the person (s) who receive it? (multiple choice, total response:[376, 453, 618])
3.32 How many people in your household are directly benefited by the financial aid you receive?
3.33 What is the main occupation of the person sending financial aid from abroad?
3.34 Have you been aware of how long you have received financial aid from abroad?
Number of years that you have received financial aid from abroad:
Number of months that you have received financial aid from abroad:
3.35 How often do you receive financial aid from abroad?
3.36 Has the economic aid received from abroad been affected by the COVID-19 pandemic?
3.37 What type of financial aid does the household receive with the greatest impact?
3.38 Could you indicate how much money you regularly receive per shipment?
Please indicate the currency with which you will enter the remittance amount:
Amount of the remittance:
3.39 What do you mainly use the cash assistance you receive for? (multiple choice, total response:[370, 439, 607])
3.40 Where do you collect the money they send you? (multiple choice, total response:[370, 439, 607])
3.41 Who decides how the money sent from abroad should be spent?
3.42 What is the gender of the person (s) who decides (s) how to spend the money that is sent from abroad?
3.43 What type of goods or services do you regularly receive from abroad? (multiple choice, total response:[21, 82, 52])
3.44 In the last 5 years, how many people in your household constantly travel back and forth to other country (s)?
3.49 In the last 5 years, how many people from your household or who have been part of your household have migrated or migrate to other area (s) of the country?
4.1 Cereals, roots and tubers
4.2 Legumes, nuts and dried seeds
4.3 Milk, dairy products and other derivatives
4.4 Meat, egg and fish
4.4a Fresh meats
4.4b Viscera red
4.4c Fish / Seafood
4.4d Eggs
4.5 Vegetables, greens, leaves and greens
4.5a Orange vegetables
4.5b Leafy greens
4.6 Fruits
4.6a Orange fruits
4.7 Fats
4.8 Sugars and sweets
4.9 Spices, condiments and drinks
5.1 During the past 7 days, how many times has someone in your household eaten less preferred or cheaper foods?
5.2 During the last 7 days, how many times has someone in your household borrowed food (on credit) or had the help of friends and family?
5.3 During the past 7 days, how many times have the adults in your household reduced the amount of food consumed for the children to eat?
5.4 During the past 7 days, how many times has someone in your household reduced the size of food portions?
5.5 During the past 7 days, how many times has someone in your household reduced the number of meals eaten per day?
5.6 During the past 7 days, how many times has someone in your household gone whole days without eating?
6.1 During the past 30 days, has anyone in your household bought food on credit (on credit)?
6.2 During the past 30 days, has anyone in your household borrowed money to buy food?
6.3 During the past 30 days, did someone in your household send people in the household to eat with friends or family?
6.5 During the past 30 days, did anyone in your household sell household assets or goods (TV, washing machine, furniture, refrigerator, kitchen, etc.)?
6.6 During the last 30 days, did anyone in your household sell productive assets (basic tools to carry out work)?
6.7 During the last 30 days, did anyone sell the household's means of transport (car, motorcycle, bicycle, animal for transport, etc.)?
6.8 During the past 30 days, did anyone in your household sell your house, land, or property?
6.9 During the last 30 days, did someone in your household take the children out of school to contribute to the household economy?
6.10 During the last 30 days, did anyone in your household find it necessary to seek informal, risky, poorly paid or daily paid work (wages)?
6.11 During the last 30 days, did anyone in your household have to migrate abroad due to lack of food?
6.12 During the last 30 days, did anyone in your household have to work for food (and not money)?
6.13 During the past 30 days, did anyone in your household have to go out and ask for money on the streets?
7.23 In the last 6 months, how has the household income been to cover health, education, clothing, debt, social events and / or home repair expenses?
8.1a Main source to cover basic needs:
8.1b What percentage of the total household income provides this livelihood?
8.1c Enter the temporality of the livelihood:
8.2a Second source to cover basic needs:
8.2b What percentage of the total household income provides this livelihood?
8.2c Enter the temporality of the livelihood:
8.3a Third source to cover basic needs:
8.3b What percentage of total household income does this livelihood provide?
8.3c Enter the temporality of the livelihood:
8.4 Did one or more people in your household lose their job or business due to the COVID-19 pandemic?
8.5 How has the COVID-19 pandemic impacted your family's sources of income?
8.6 Could you indicate what is the average income in your household per month?
8.6.1 Please indicate the currency with which you enter the deposit amount:
8.6.2 Monthly income:
8.7 Does the household have savings at this time?
8.9 Does the household have any debt or credit to pay at this time?
8.10 What was the main reason why you applied for the loan or the household got into debt?
8.11 What is the main source of credit for all current debts and loans?
8.12 Could you indicate how much is the total debt (s) that the household has to pay at this time?
8.12.1 Please indicate the currency with which you enter the debt amount:
8.12.2 Debt:
8.13 In how many months do you think you will be able to pay your debts or credit?
8.14 Do you or does anyone in your household have an account in a bank?
8.15 What is the sex of the person (s) who have a bank account?
9.1 During the last 6 months, has your household received support from any government program?
9.2 What kind of support has your household received from the government? (multiple choice, total response:[619, 252, 1574])
9.3 During the last 6 months, has your household received benefits from a church, NGO, private company and / or the United Nations?
9.4 What kind of support has your household received from a church, NGO, private company and / or the United Nations? (multiple choice, total response:[122, 277, 161])
10.1 What is the main source of drinking water in your home?
10.2 What is the main source of water for domestic use in your home (cleaning, hygiene, irrigation)?
10.3 Does your home have electricity?
10.4 If you do not have electricity, what sources does your home use to produce energy? (multiple choice, total response:[210, 130, 104])
10.5 What type of fuel is cooked in your home?
10.6 What is the main way to dispose of garbage in your home?
11.1 What type of home does your family live in?
11.2 What type of tenure does your homestead have?
11.3 What sex is the person who has the title to the property?
11.4 The predominant material of the flooring is:
11.5 The predominant material of the walls is:
11.6 The predominant material of the roof is:
11.7 How many rooms are used exclusively for sleeping by the people in your household?
11.8 What type of health service does the household use?
Refrigerator / fridge:
Washer and / or dryer:
Computer:
Residential Internet:
TV / screens:
Cable TV:
Gas or electric cooker:
Landline:
Water heater:
Air-conditioning:
Microwave oven:
Water tank:
Car or motorcycle:
Stereo:
12.1 In the last three years, has your home been impacted by any natural hazards? (multiple choice, total response:[1730, 1565, 1703])
First concern:
Second concern:
Third concern:
12.4 What types of insecurity situations occur in your locality? (multiple choice, total response:[1730, 1565, 1703])
12.5 Do you consider that in the last year violence in the place where you live has:
13.1 Are you and the people in your household satisfied with the area where you live?
13.2 Right now, do you think that the economic conditions in the area where you live are getting better or worse?
13.3 At this moment, do you feel that your standard of living is improving or deteriorating?
13.4 Are they satisfied or dissatisfied with their standard of living, with what they can buy and do?
13.5 Which of these statements is closest to how you feel about your household income these days?
13.6 Do you consider that most of the children of this country have the opportunity to learn and grow every day?
13.7 In this country, do you have confidence in the honesty of the elections of the country's rulers?
hh_df = pd.read_csv('data_final/hh_roster.csv', index_col=0)
for attribute in hh_df.columns:
if not attribute.startswith('_') and not ('/' in attribute) and not ('note' in attribute) and (attribute != 'rsp_id') and (attribute != 'country'):
plot_data(hh_df, attribute, split_country = True)
2.5 Sex:
2.6 Age:
2.7 Currently, what is the condition / status of the person with regard to migration abroad?
2.8 Higher level of completed studies:
2.9 During the past 30 days, has this person done any work to earn an income?
2.10 Main occupation:
2.11 What was the main occupation that the person had before migrating?
2.12 During the current educational year, does this person attend classes or other formal learning activity?
2.13 What has been the main modality with which you have received classes during this year?
2.14 What are the main reasons why you are not registered or do not attend classes regularly? (multiple choice, total response:[1157, 859, 318])
2.15 During this year, has the School Feeding Program worked in the School Center where the child attends?
2.16 Is this person the one who contributes most of the resources to the household?
2.17 Is this person one of the household income managers?
2.18 Is this person involved in housework?
2.19 Is the person pregnant?
2.20 Is the person breastfeeding?
2.21 Please indicate if the person has any of the following conditions: (multiple choice, total response:[7883, 6516, 6918])
ext_df = pd.read_csv('data_final/mig_ext_roster.csv', index_col=0)
for attribute in ext_df.columns:
if not attribute.startswith('_') and not ('/' in attribute) and not ('note' in attribute) and (attribute != 'rsp_id') and (attribute != 'country'):
plot_data(ext_df, attribute, split_country = True)
3.14 Please indicate gender:
3.15 Please indicate the age:
3.16 What are the main reasons why the person migrated or tried to migrate? (multiple choice, total response:[524, 585, 515])
3.17 Who did you travel with the last time you migrated or tried to migrate? (multiple choice, total response:[524, 585, 515])
3.18 What was the main means you used to migrate or attempt to migrate abroad the last time? (multiple choice, total response:[524, 585, 515])
3.19 Do you know how much the trip to the destination country cost (will cost) in total?
3.19.1 Please indicate the currency with which you will enter the cost of the trip to the country of destination
3.19.2 Please enter the total cost of the trip to the destination country
3.19.3 How many attempts does the cost of the trip to the country of destination include (included)?
3.20 Do you know how the travel expenses were distributed (transport, subsistence, intermediaries or others)?
What percentage did you use (will you use) in TRANSPORTATION to cover the trip to the destination country?
What percentage did you use (will you use) in SUBSISTENCE (food, medicine, accommodation, etc.) to cover the trip to the country of destination?
What percentage did you use (will you use) in INTERMEDIARIES to cover the trip to the country of destination?
What percentage did you use (will you use) in OTHER expenses to cover the trip to the destination country?
Sum of percentage of expenses to cover the trip to the destination country?
3.21 How did you finance your trip? (multiple choice, total response:[524, 585, 515])
3.22 Did you suffer any act or situation of violence during your migration route? (multiple choice, total response:[462, 393, 394])
3.23 Could you indicate the actors who carried out the acts of violence? (multiple choice, total response:[75, 85, 63])
3.24 To which country were you heading when you last migrated or tried to migrate abroad?
3.24.1 Please indicate which is the other country you were going to when migrating or trying to migrate abroad the last time
3.25 Was the person who migrated to the destination last time able to arrive?
3.26 Why did the person who migrated return?
int_df = pd.read_csv('data_final/mig_int_roster.csv', index_col=0)
for attribute in int_df.columns:
if not attribute.startswith('_') and not ('/' in attribute) and not ('note' in attribute) and (attribute != 'rsp_id') and (attribute != 'country'):
plot_data(int_df, attribute, split_country = True)
3.50 Please indicate gender:
3.51 Please indicate age:
3.52 How long does the person migrate (migrated) to other area (s) of the country?
3.53 How often do you migrate to other area (s) of the country?
3.54 What are the main reasons why the person migrates (migrated) to other area (s) of the country? (multiple choice, total response:[133, 378, 210])
3.55 To which department (s) do you migrate from Guatemala? (multiple choice, total response:[133, 0, 0])
3.55 To which department (s) do you migrate (migrated) from El Salvador? (multiple choice, total response:[0, 0, 210])
3.55 To which department (s) do you migrate from Honduras? (multiple choice, total response:[0, 378, 0])
3.56 To which area does the place where the person migrates (migrated) to other area (s) of the country belong?
pend_df = pd.read_csv('data_final/mig_pend_roster.csv', index_col=0)
for attribute in pend_df.columns:
if not attribute.startswith('_') and not ('/' in attribute) and not ('note' in attribute) and (attribute != 'rsp_id') and (attribute != 'country'):
plot_data(pend_df, attribute, split_country = True)
3.45 Please indicate gender:
3.46 Please indicate age:
3.47 What are the reasons why the person travels to and from other country (s)? (multiple choice, total response:[109, 105, 170])
3.48 To which country (countries) do you travel regularly to and from? (multiple choice, total response:[109, 105, 170])
3.48.1 Please indicate which is the other country to which you regularly travel back and forth